﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _003_类的定义与声明
{
    class Program
    {
        static void Main(string[] args)
        {
            Vehicle car1 = new Vehicle();
            car1.speed = 120;
            car1.Run();
            car1.Stop();
            Console.WriteLine(car1.speed);

            Vector3 v1 = new Vector3(1,1,1);//利用构造函数传参
            //调用参数传参
            /*v1.x = 1;
            v1.y = 1;
            v1.z = 1;*/
            //利用方法传参
            /*v1.SetX(1);
            v1.SetY(1);
            v1.SetZ(1);*/
            Console.WriteLine("向量长度为："+v1.Length());


            /* //使用属性
             v1.MyIntProperty = 600;//对属性设置值
             int temp2 = v1.MyIntProperty;//对属性取值
             Console.Write(temp2);//因为在get属性里设置了返回值是一百*/

            //使用属性来给x传参
            v1.X = 50;
            Console.WriteLine(v1.X);

            Console.ReadKey();

        }
    }
}
